<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  function arr(x, n) {
    const negative = n < 0;
    let res = 1;
    n = Math.abs(n);

    for (let i = 0; i < n; i++) {
      res *= x;
    }
    return negative ? 1 / res : res;
  };
  console.log(arr(x = 2.00000, n = 10));
</script>

</html>